import type { FacilityDetail } from "@dci/core"; import { cache } from "react"; import { api, type ApiResult } from "@/lib/api"; /** Per-request memoised facility loader shared by layout (existence check), metadata, page and OG image. */ export const getFacility = cache(async (slug: string): Promise> => api.facility(slug)); /** The API returns `mwIsEstimate` (not yet in the shared contract). */ export function mwIsEstimate(f: FacilityDetail): boolean { return Boolean((f as FacilityDetail & { mwIsEstimate?: boolean | null }).mwIsEstimate); }